<template>
  <div>
    <el-dialog
      title="告警记录"
      :visible.sync="dialogVisible"
      width="60%"
      :before-close="closeDialog"
      :close-on-click-modal="false"
      append-to-body
    >
      <Alarm ref="refAlarm" :deviceInfo="deviceInfo" />
    </el-dialog>
  </div>
</template>

<script>
import Alarm from "@/components/DeviceInfo/components/alarm.vue";
export default {
  props: {
    deviceInfo: {
      type: Object,
      default: () => {},
    },
  },
  components: {
    Alarm,
  },

  data() {
    return {
      dialogVisible: false,
    };
  },
  computed: {},
  watch: {
    dialogVisible(e) {
      if (e) {
        this.$nextTick(async () => {
          this.$refs.refAlarm.AlarmList();
        });
      }
    },
  },
  mounted() {},
  methods: {
    // 点击关闭弹框
    closeDialog() {
      this.dialogVisible = false;
    },
  },
};
</script>

<style lang="less" scoped>
@import url("../../../../views/common.less");
.titles {
  position: relative;
  font-size: 14px;
  border-bottom: 2px solid @primaryBorderColor;
  padding-bottom: 8px;
  margin: 0 3px 15px;
  display: flex;
  color: @primaryThemeTxtColor2;
  .ant-col {
    width: 160px;
    .red-star {
      color: #f56c6c;
    }
  }
}
.list {
  position: relative;
  display: flex;
  align-items: center;
  .icon {
    font-size: 20px;
    // color: #d55b67;
    color: #7367f0;
    cursor: pointer;
    padding-top: 5px;
    margin-top: 10px;
  }
  .el-icon-circle-plus-outline {
    font-size: 20px;
    margin-left: 8px;
  }
}
</style>
